package com.kongyz;

/**
 * @author kongyz
 * @date 2018/6/21 21:16
 * @Description: 懒汉式，线程不安全
 */
public class Singleton1 {
    public static Singleton1 instance; //私有静态变量
    private Singleton1(){} //私有构造方法
    //全局静态访问入口
    public static Singleton1 getInstance(){
        if(instance==null){
            instance=new Singleton1();
        }
        return instance;
    }
}
